export const routes = [
  {
    path: '/',
    redirect: '/login',
  },
  {
    path: '/layout',
    name: 'Layout',
    component: () => import('@/layout/index.vue'),
    meta: {
      title: '样版',
      keepAlive: true,
    },
    children: [
      {
        path: '/home',
        name: 'Home',
        component: () => import('@/view/home/index.vue'),
        meta: {
          keepAlive: true,
          title: '工作台',
          sort: '1',
          icon: 'icon-gongzuotai',
        },
      },
      // 实验室管理
      {
        path: '/laboratoryManagement',
        name: 'LaboratoryManagement',
        component: () => import('@/view/laboratoryManagement/index.vue'),
        meta: {
          keepAlive: true,
          title: '实验室管理',
          sort: '2',
          icon: 'icon-laboratory',
        },
      },
      // 实验员管理
      {
        path: '/experimentalistManagement',
        name: 'ExperimentalistManagement',
        component: () => import('@/view/experimentalistManagement/index.vue'),
        meta: {
          keepAlive: true,
          title: '实验员管理',
          sort: '3',
          icon: 'icon-experimentalist',
        },
      },
      // 货品管理
      {
        path: '/goodsManagement',
        name: 'GoodsManagement',
        component: () => import('@/view/goodsManagement/index.vue'),
        meta: {
          keepAlive: true,
          title: '货品管理',
          sort: '4',
          icon: 'icon-goods',
        },
      },
      // 类别管理
      {
        path: '/categoryManagement',
        name: 'CategoryManagement',
        component: () => import('@/view/categoryManagement/index.vue'),
        meta: {
          keepAlive: true,
          title: '类别管理',
          sort: '5',
          icon: 'icon-category',
        },
      },
      // 度量管理
      {
        path: '/metricsManagement',
        name: 'MetricsManagement',
        component: () => import('@/view/metricsManagement/index.vue'),
        meta: {
          keepAlive: true,
          title: '度量管理',
          sort: '6',
          icon: 'icon-metrics',
        },
      },
      {
        path: '/systemSetting',
        name: 'SystemSetting',
        component: () => import('@/view/systemSetting/index.vue'),
        meta: {
          title: '系统设置',
          sort: '7',
          keepAlive: true,
          icon: 'icon-menu_xtsz',
        },
      },
      {
        path: '/authorityManagement',
        name: 'AuthorityManagement',
        meta: {
          title: '权限管理',
          sort: '8',
          keepAlive: true,
          icon: 'icon-quanxianguanli_fill',
        },
        children: [
          {
            path: '/userManagement',
            name: 'UserManagement',
            meta: {
              title: '用户管理',
              sort: '8-1',
              keepAlive: true,
              icon: 'icon-yonghuguanli',
            },
            component: () => import('@/view/userManagement/index.vue'),
          },
          {
            path: '/roleManagement',
            name: 'RoleManagement',
            meta: {
              title: '角色管理',
              sort: '8-2',
              keepAlive: true,
              icon: 'icon-jiaoseguanli',
            },
            component: () => import('@/view/roleManagement/index.vue'),
          },
          {
            path: '/authoritySetting',
            name: 'AuthoritySetting',
            meta: {
              title: '权限设置',
              sort: '8-3',
              keepAlive: true,
              icon: 'icon-quanxianshezhi',
            },
            component: () => import('@/view/authoritySetting/index.vue'),
          },
        ],
      },
    ],
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/view/login/index.vue'),
    meta: {
      keepAlive: true,
    },
  },
  {
    path: '/notRoleView',
    name: 'NotRoleView',
    component: () => import('@/view/notRoleView/index.vue'),
    meta: {
      keepAlive: true,
    },
  },
]

// 权限表
export const roleNameList = [
  {
    role: 1,
    roleNames: [
      'Layout',
      'Home',
      'Login',
      'NotRoleView',
      'LaboratoryManagement',
      'ExperimentalistManagement',
      'GoodsManagement',
      'CategoryManagement',
      'MetricsManagement',
      'SystemSetting',
    ],
  },
  {
    role: 2,
    roleNames: [
      'Layout',
      'Home',
      'Login',
      'NotRoleView',
      'LaboratoryManagement',
      'ExperimentalistManagement',
      'GoodsManagement',
      'CategoryManagement',
      'MetricsManagement',
      'SystemSetting',
    ],
  },
  {
    role: 3,
    roleNames: [
      'Layout',
      'Home',
      'Login',
      'NotRoleView',
      'GoodsManagement',
      'SystemSetting',
    ],
  },
]
